#!/usr/bin/env bash

if [[ "$UID" -eq "0" ]]
then
  echo "You are root."
else
 echo "not root"
 exit 1
fi

#centos7.4
##docker's install
#yum的版本1.13，太老
#yum install -y docker.x86_64

#使用docker-ce18版本
yum install libtool-ltdl
yum install -y container-selinux
wget https://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/stable/Packages/docker-ce-18.06.1.ce-3.el7.x86_64.rpm
rpm -ivh docker-ce-18.06.1.ce-3.el7.x86_64.rpm
systemctl enable docker
systemctl restart docker

docker -v

##docker-compose's install
#https://docs.docker.com/compose/install/
curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

docker-compose version

#load docker images
#docker load < nginx1.17.tar.gz
